package xx.thread.base;

public class ThreadGetResByRunable implements Runnable {

    private int count = 15;

    @Override
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println(Thread.currentThread().getName() + "运行  count= " + count--);
            try {
                Thread.sleep((int) Math.random() * 10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        ThreadGetResByRunable t = new ThreadGetResByRunable();
        new Thread(t, "A").start();
        new Thread(t, "B").start();
        new Thread(t, "C").start();
    }
}
